<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    //    创建Promise
    let p1 = new Promise((resolve,reject)=>{
        setTimeout(()=>{
            console.log('异步');
            resolve(11);
        },3000)
    })

    P1.then(
        (res)=>{
            console.log('p1成功1'+res);
        },
        (res)=>{
            console.log('p1失败1'+res);
        }
    )
    p1.then(
        (res)=>{
            console.log('p1成功2'+res);
        },
        (res)=>{
            console.log('p1失败2'+res);
        }
    )
    // ).catch(
    //     (res)=>{
    //         console.log(res);
    //     }
    // ).finally(
    //     (res)=>{
    //         console.log(res);
    //     }
    // )
    
    </script>
</body>
</html>